import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.util.Date;

import wiki.so.api.AnswerMetadata;
import wiki.so.api.QuestionMetadata;

import il.ac.technion.wiki.api.Author;
import il.ac.technion.wiki.api.Content;
import il.ac.technion.wiki.api.Metadata;
import il.ac.technion.wiki.api.Metadata.Language;
import il.ac.technion.wiki.api.WikiPageExceptions;
import il.ac.technion.wiki.impl.DataBase;
import il.ac.technion.wiki.impl.HtmlContent;
import il.ac.technion.wiki.impl.WikiPageStandard;


public class Foo {

	/**
	 * @param args
	 * @throws WikiPageExceptions 
	 * @throws IllegalAccessException 
	 * @throws IllegalArgumentException 
	 * @throws NoSuchFieldException 
	 * @throws SecurityException 
	 */
	public static void main(String[] args) throws WikiPageExceptions, IllegalArgumentException, IllegalAccessException, SecurityException, NoSuchFieldException {
		WikiPageStandard wiki = new WikiPageStandard();
		DataBase db = new SomeDb();
		
		Field fi = WikiPageStandard.class.getDeclaredField("db");
		fi.setAccessible(true);
		fi.set(wiki, db);
		
		Metadata meta = new Metadata("foo", new Date(), Language.ENGLISH, new Author("s", "a", "k"));
		HtmlContent content = new HtmlContent(meta, "<a href='google.com'>hi</a> <i>is hot</i>");
		content.setContentName("some_c");
		wiki.addNewPage(content);
		
		HtmlContent f = (HtmlContent) wiki.find("\"hi\"");
		System.out.println("Name: " + f.getContentName());
		System.out.println("Text: " + f.getPlainText());
		
		Content c;
		c.getContentName();
	}

}
